package com.swallowtech.mysnscore.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

public abstract class AbstractSNSEntry implements SNSEntry,Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String id;

	private String title;

	private Date pubDate;

	private Date updateDate;

	private Boolean allowComments = Boolean.TRUE;

	private String creatorUserName;
	
	
	// associations
	private Set<Tag> tags = new HashSet<Tag>();
	private Space space;

	/**
	 * @return the id
	 */
	public String getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(String id) {
		this.id = id;
	}

	/**
	 * @return the title
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * @param title the title to set
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	/**
	 * @return the pubDate
	 */
	public Date getPubDate() {
		return pubDate;
	}

	/**
	 * @param pubDate the pubDate to set
	 */
	public void setPubDate(Date pubDate) {
		this.pubDate = pubDate;
	}

	/**
	 * @return the updateDate
	 */
	public Date getUpdateDate() {
		return updateDate;
	}

	/**
	 * @param updateDate the updateDate to set
	 */
	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	/**
	 * @return the allowComments
	 */
	public Boolean getAllowComments() {
		return allowComments;
	}

	/**
	 * @param allowComments the allowComments to set
	 */
	public void setAllowComments(Boolean allowComments) {
		this.allowComments = allowComments;
	}

	/**
	 * @return the creatorUserName
	 */
	public String getCreatorUserName() {
		return creatorUserName;
	}

	/**
	 * @param creatorUserName the creatorUserName to set
	 */
	public void setCreatorUserName(String creatorUserName) {
		this.creatorUserName = creatorUserName;
	}	
	
	/**
	 * @return the tags
	 */
	@Override
	public Set<Tag> getTags() {
		return tags;
	}

	@Override
	public void addTag(Tag tag){
		this.tags.add(tag);
	}
	/**
	 * @param tags the tags to set
	 */
	public void setTags(Set<Tag> tags) {
		this.tags = tags;
	}
	
	/* (non-Javadoc)
	 * @see com.swallowtech.mysnscore.domain.SNSEntry#getSpace()
	 */
	@Override
	public Space getSpace() {
		// TODO Auto-generated method stub
		return this.space;
	}

	/* (non-Javadoc)
	 * @see com.swallowtech.mysnscore.domain.SNSEntry#setSpace(com.swallowtech.mysnscore.domain.Space)
	 */
	@Override
	public void setSpace(Space space) {
		this.space = space;
		
	}	

}
